Method and a scheduler for controlling when a server provides service with rate control to an entity

ABSTRACT

A method for scheduling when a server provides service to entities. The method includes the steps of identifying when a first entity requests service from the server. Next there is the step of providing service to an entity, such as a first entity or a second entity, as a function of virtual time. A scheduler for controlling when a server provides service to entities. The scheduler comprises a memory having times which are a function of when entities request service from the server. The scheduler is also comprised of a virtual clock that keeps track of time. The scheduler is also comprised of a controller which causes an entity to receive service from the server as a function of virtual time. Rate can also be utilized.

This is a continuation-in-part of copending application Ser. No. 08/362,217 filed on Dec. 22, 1994.

FIELD OF THE INVENTION

The present invention is related to a scheduler. More specifically, the present invention is related to a scheduler which allows an entity to receive service from a server before its finishing time.

BACKGROUND OF THE INVENTION

In circumstances where available resources must be shared among a number of different users, problems of congestion can occur for utilization of the resources. Quite simply, there may be times when different users desire to use a given resource at the same time, but the resource's capability only allows it to serve one user at a time. To control this congestion problem, a scheduler is typically utilized to order when a user has access to the server.

Ideally, the scheduler will provide the users access to the server in a fair manner so that no user will experience an undue delay based on its needs. In the past, scheduler's have not necessarily been fair to users when the users have a significant divergence in their needs. Many times, either the user with the greatest needs is left waiting while the user with the lowest needs is being served by the server, and vice versa. The present invention is directed to meeting the needs of users so users having lower needs can be served at times when users of greater needs do not require service at a given time. Furthermore, the present invention provides for rate control of the server so the server does not always have to be serving a user.

SUMMARY OF THE INVENTION

The present invention pertains to a scheduler for controlling when N entities, where N is an integer ≧1, are serviced by a server. The scheduler comprises a starting time memory having starting times s_(i) of the N entities, where 1≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity requests service from the server. The scheduler is also comprised of a finishing time memory having finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity should be serviced by the server. The scheduler is also comprised of a virtual clock that keeps track of virtual time so the starting times s_(i) and finishing times f_(i) can be identified. Additionally, the scheduler comprises a controller which chooses entities to receive service from the server in the order of the entities with an earliest finishing time f_(i) and a starting time s_(i) being serviced first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being serviced next at each given time. If rate control is used, then there is the alternative criteria of if there is no entity with a starting time less than or equal to virtual time, the server does not provide service to any entity and the virtual clock increments virtual time by one unit of virtual time. In rate control, the virtual time is always incremented by sore unit of virtual time, and preferably one unit of virtual time, as a function of time regardless of what the server is doing. Preferably, the function of time is simply a predetermined period of time. As is apparent from the latter, if the entities' finishing times are the same, then whatever protocol is desired to indicate which entity is to be provided to the server to be operated upon is the choice of the operator.

The present invention pertains to a method of scheduling when a server provides service to entities. The method comprises the steps of requesting service from the server by N entities, where N≧1 and is an integer. Then there is the step of storing when each of the N entities starts requesting service and when each of the N entities should have received service. Next, there is the step of providing service to an entity of the N entities which has the earliest receive time and start time, unless there is more than one entity with the earliest receive time in which case the entity with the earliest start time receives service and possibly before its receive time. If rate control is used, then there is the alternative criteria of if there is no entity with a start time less than or equal to virtual time, then the server is idle and virtual time is incremented by some unit of virtual time as a function of time.

The present invention pertains to a scheduler for scheduling when N entities each of which has a weight w, where N is an integer ≧1 and w is a real number, are served by a server. The scheduler is comprised of a starting time memory having starting times s_(i) when the N entities request service, where 1≦i<N and is an integer, and s_(i) is the time at which the i'th entity may next get service from the server. The scheduler is also comprised of a finishing time memory having finishing times f_(i) when the N entities should be serviced, where f_(i) is the time by which the i'th entity should be serviced by the server. The scheduler is also comprised of a virtual clock that keeps track of time V_(k) where k≧0 and is an integer and ##EQU1## where s_(Smin) is the earliest start time s_(i) of when an entity requests service from the server; f_(Fmin) is the earliest finish time of an entity waiting for service from the server; V_(k-1) is the virtual time when the server last served an entity; AW=sum over all entities currently asking for service of w_(i), where w_(i) is the i'th entity's weight; and P, X, T, Y and Z are real numbers. Preferably, P=1, T=0, X=1, Y=1 and Z=0, but based on the application and the purpose, either T or X can be essentially any real number as long as both are not 0; and either Y or Z can be essentially any real number as long as both are not 0. If rate control is utilized, then Y=Z=0 and the last line of the equation is not applicable.

The scheduler is also comprised of a controller which chooses which entity is to be operated upon by the server in the order of the entity with an earliest finishing time f_(i) and a start time s_(i) receiving service first, and then the entities based on a predetermined criteria. The predetermined criteria can essentially be any type of tie-breaking procedure that the user wishes to apply such as earliest start time or id number, etc. If rate control is utilized, there is the alternative criteria of if there is no entity with a start time less than or equal to virtual time, the server does not provide service to any entity and the virtual clock increments virtual time preferably by one unit of virtual time as a function of time and preferably after a predetermined period of time.

The present invention pertains to a method for scheduling when a server provides service to entities. The method comprises the steps of identifying when a first entity requests service from the server. Next there is the step of providing service to an entity, such as a first entity or a second entity, as a function of when the entity requests service from the server. If rate control is utilized, then the providing step is a function of virtual time, and there is the additional step of incrementing virtual time by one unit of virtual time after a predetermined period of time.

The present invention pertains to a scheduler for controlling when a server provides service to entities. The scheduler comprises a memory having times which are a function of when entities request service from the server. The scheduler is also comprised of a virtual clock that keeps track of virtual time as a function of when entities request service from the server. The scheduler is also comprised of a controller which causes an entity to receive service from the server as a function of when the entity requests service from the server. If rate control is utilized, then the virtual clock keeps track of time as a function of time and preferably a predetermined period of time.

BRIEF DESCRIPTION OF THE DRAWINGS

In the accompanying drawings, the preferred embodiment of the invention and preferred methods of practicing the invention are illustrated in which:

FIG. 1 is a schematic representation of the present invention.

FIGS. 2-11 are schematic representations of cells waiting for service from a server as a function of virtual time.

FIGS. 12-20 are schematic representations of cells waiting for service from a server as a function of virtual time.

FIG. 21 is a schematic representation of an ATM switch element.

FIG. 22 is a flow chart of a method of scheduling when a server provides service to entities of the present invention.

FIG. 23 is a flow chart of an alternative method of scheduling when a server provides service to entities of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring now to the drawings wherein like reference numerals refer to similar or identical parts throughout the several views, and more specifically to FIG. 1 thereof, there is shown a scheduler 10 for controlling when N entities 12, where N is an integer ≧1, are operated upon by a server 14. The scheduler 10 comprises a starting time memory, such as a priority queue 16, having starting times s_(i) of the N entities, where 1≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity starts requesting service from the server 14. The scheduler 10 is also comprised of a finishing time memory, such as a priority queue 18, having finishing times f_(i) of the N entities 12, where f_(i) corresponds to the time the i'th entity should be operated upon by the server 14. The scheduler 10 is also comprised of a virtual clock 20 that keeps track of time so the starting times s_(i) and finishing times f_(i) can be identified. Additionally, the scheduler 10 comprises a controller 22 which provides entities service from the server 14 in the order of the entities with an earliest finishing time f_(i) and a start time s_(i) being operated upon first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being operated upon next at each given time. As is apparent from the latter, if the entities' finishing times are the same, then whatever protocol is desired to indicate which entity is to be provided to the server 14 to be operated upon is the choice of the operator. If rate control is used, then there is the alternative criteria of if there is no entity with a starting time less than or equal to virtual time, the server does not provide service to any entity and the virtual clock increments virtual time by one unit of virtual time as a function of time and preferably after a predetermined period of time. It should be noted that even when the server does not provide service, the virtual clock increments virtual time by one unit of virtual time. Thus, virtual time always advances by one increment of virtual time.

Preferably, scheduler 10 can include an element pool 24 which is connected with the N entities 12 and receives elements from the N entities 12 to be operated upon by the server 14. The arrival times s_(i) of elements then corresponds to the time elements from the i'th entity 12 arrives in the element pool 24 and the finishing times f_(i) correspond to the time an element from the i'th entity 12 is to leave the element pool 24 and be operated upon by the server 14.

The controller 22 transfers or chooses elements to be operated upon by the server 14 from the element pool 24. Preferably, the controller 22 is connected to the virtual clock 20, the element pool 24, the starting time priority queue 16 and the finishing time priority queue 18 for controlling time of the virtual clock 20, storing the elements in the element pool 24, and the arrival times s_(i) and their finishing times f_(i) in the starting time priority queue 16 and the finishing time priority queue, respectively. The controller 22 preferably operates upon entities or elements of the element pool 24 sequentially. Preferably, the controller 22 causes the virtual clock 20 to move present virtual time forward when an entity receives service or an element leaves the element pool 24. The controller 22 can cause the virtual clock 20 to increment virtual time to the earliest starting time of an entity or an element if the earliest start time of an entity is later than virtual time, otherwise, the controller 22 causes the virtual clock 20 to increment virtual time by a unit of virtual time. If rate control is utilized, then the controller only causes the latter to occur preferably after a predetermined time if no service is provided.

In the embodiment with an element pool 24 present, the controller 22 transfers the element out of the element pool 24 which has the earliest finishing time f_(i) and a starting time s_(i) unless there is more than one element with the earliest finishing time fi, in which case, preferably, the element with the earliest starting time s_(i) is transferred out of the element pool 24 by the controller 22 and before its finishing time f_(i), unless there is no element with a starting time s_(i) less than or equal to virtual time, in the element pool, in which case no element is transferred out of the element pool 24 by the controller if rate control is utilized.

The present invention pertains to a scheduler 10 for scheduling when N entities each of which has a weight w, where N is an integer ≧1 and w is a real number, are served by a server 14. The scheduler 10 is comprised of a starting time memory 16 having starting times s_(i) when the N entities 12 request service, where 1≦i≦N and is an integer, and s_(i) is the time at which the i'th entity may next get service from the server 14. The scheduler 10 is also comprised of a finishing time memory 18 having finishing times f_(i) when the N entities should be serviced, where f_(i) is the time by which the i'th entity should be serviced by the server 14. The scheduler 10 is also comprised of a virtual clock 20 that keeps track of time V_(k) where k≧0 and is an integer and ##EQU2## where S_(Smin) is the earliest start time s_(i) of when an entity requests service from the server 14; f_(Fmin) is the earliest finish time of an entity waiting for service from the server 14; V_(k-1) is the virtual time when the server 14 last served an entity; AW=sum over all entities currently asking for service of w_(i), where w_(i) is the i'th entity's weight; and P, X, T, Y and Z are real numbers. Preferably, P=1, T=0, X=1, Y=1 and Z=0, but based on the application and the purpose, either T or X can be essentially any real number as long as both are not 0; and either Y or Z can be essentially any real number as long as both are not 0. If rate control is utilized, then Y=Z=0 and the last line of equation (1) is not applicable, or in other words, V_(k) =V_(k-1) +1.

The scheduler 10 is also comprised of a controller which chooses which entity is to be operated upon by the server 14 in the order of the entity with an earliest finishing time f_(i) and a start time s_(i) receiving service first, and then the entities based on a predetermined criteria. The predetermined criteria can essentially be any type of tie-breaking procedure that the user wishes to apply such as earliest start time or id number, etc. If rate control is utilized, there is the alternative criteria of if there is no entity with a start time less than or equal to virtual time, the server does not provide service to any entity and preferably the virtual clock increments virtual time by one unit of virtual time.

More specifically, let w_(i) be the "weight" of the i'th entity where 0<w_(i) <=1. W_(i) represents the fractional share of the server 14 which the i'th entity is entitled to (if w_(i) =1 then the server 14 is totally dedicated to the i'th entity, if w_(i) =0.5 then 1/2 of the server's work is dedicated to the i'th entity). Note: in this context "1" is used to represent the maximum rate of work of the server 14, so it makes no sense to give a single entry a weight which would be equal to greater than 100% of the capacity of the server 14).

Preferably, the sum of the weights of all entities will be less than or equal to 1 if the entities are not restricted as to how much work they can ask the server 14 to perform. This is equivalent to not allocating more than 100% of the server 14 capacity. If an entity is somehow restricted from asking for more than some fraction (say RS_(i) <1) of the server's capacity, then a more general statement is that the sum (over all entities) of MIN(w_(i), RS_(i)) should be less than 1.

Let W=sum over all entities of w_(i) ##EQU3## Let AW=sum over all entities current asking for service of w_(i) (i.e. if "W" is sum of Weights then "AW" is sum of Active Weights) ##EQU4## where a_(i) =0 if not asking for service, a_(i) =1 if asking for service.

Additionally, s_(i) is the time at which the i'th entity may next get service and f_(i) is the time by which the i'th entity should be serviced.

Let u_(i) be the number of units of work that the server gives the i'th entity when it does work for the i'th entity (for simplicity assume the case where for all entities u_(i) =1 (in the case of a packet network this is equivalent to the case where all packets are of the same size, i.e. ATM cells)). U_(i) can be different than one based on the application. For instance, u_(i) may not be equal to one in a packet based network.

Let Fmin (1<Fmin<N)=id # of entity with the smallest finishing time (all examples given as "entity with the smallest finishing time" is understood to mean "entity that is to finish first based on any needed tie breaking").

So f_(Fmin) =value of the finishing time of the entity with the smallest finishing time.

Let Smin (1<=Smin<N)=id # of entity with the smallest starting time (what is meant here is the same as above, i.e. if there are ties assume that they are broken somehow).

So s_(Smin) =value of the starting time of the entity with the smallest starting time.

V_(k) indicates the k'th time that the server does work. ##EQU5##

Each time the server 14 performs work, it services the entity whose id # is Fmin. The server does not need to know the value of Smin to operate, it only needs to know the value of s_(Smin).

Another equation is: ##EQU6## Equation (1) is Equations (2) and (3) together. Equation (1) with ##STR1## is "Virtual Clock" (VC). See Zhang, L. (1989) "A new architecture for packet switching network protocols". Report LCS TR 455, Laboratory for Computer Science, Massachusetts Institute of Technology. Cambridge, Mass., incorporated by reference. ##STR2## is "Self-Clocked Fair Queueing" (SFQ). See "A Self-Clocked Fair Queueing Scheme for Broadband Applications" by S. J. Golestani, In Proc. IEEE Infocom, May 1994, incorporated by reference.

It is worth noting that in this case, the second half of the equation looks like ##EQU7## (and in this case the value "s_(Smin) " is not actually needed) and in fact, this is how it is conceptually described in the literature ##STR3## is "approximately" "Weighted Fair Queueing" (WFQ). See "Analysis and Simulation of a Fair Queueing Algorithms" by A. Demers, S. Keshav, and S. Shenker; Internetworking: Research and Experience, Vol. 1, 3-26 (1990), incorporated by reference, and A. K. J. Parekh, A Generalized Processor Sharing Approach to Flow Control in Integrated Services Networks, Ph.D. Dissertation, Massachusetts Institute of Technology, Cambridge, Mass., February 1992, incorporated by reference.

The real problem with this version from an implementation point of view is two-fold.

a) the computation of "AW" in this case usually requires emulating the fluid model rather than the discrete model of the server

b) the computation 1/AW is very expensive, and difficult to perform (if AW=(1-epsilon) then 1/AW=1/(1-epsilon) which is hard to compute accurately) ##STR4## is "Virtual Service Queueing" (VSQ) of the present invention.

The reason for making these observations is two-fold.

a) observing that the pairs P,T,X and Y,Z represent the two halves of the MAX function, it is clear that only VSQ has non-zero coefficients on both sides of the function.

b) if the function is rewritten in the case of SFQ to be the way that the equation is normally written in the literature then it is also clear that only VSQ utilizes the value s_(Smin).

A variation of VSQ is "Rate Control Service Queueing" (RC VSQ). When rate control is implemented Y=Z=0. But unlike VC which is not concerned with the starting time of when a user requests service from the server 10, RC VSQ requires the starting times of users to be identified and particularly the smallest starting time of a user as well as finishing times of users. Thus, in the preferred embodiment, RC VSQ comprises a starting time memory, such as the priority queue 16, as described above, and a finishing time memory, such as a priority queue 18, as described above. Then, in operation of RC VSQ, the server 10 provides service in the following manner:

If the starting time of Fmin (s_(Fmin)) is less than or equal to the virtual time, then service Fmin; else if the starting time of Smin (s_(Smin)) less than or equal to the virtual time, then service Smin; else do nothing and increment virtual time by one unit.

More succinctly written:

If S_(Fmin))<V, then service Fmin, else if s_(Smin))<V, then service Smin, else do nothing, V_(k) =V_(k-1) +1.

When rate control is implemented, the server 10 provides service at the established rate, whatever that may be, and no faster. Rate control is not necessarily work conserving while VSQ is work conserving.

The present invention pertains to a method of scheduling when a server 10 operates on entities, as shown in FIG. 22. The method comprises the steps of requesting service of the server from N elements, where N≧1 and is an integer. Then there is the step of storing when each of the N entities first requests service and when each of the N entities is to have received service from the server. Next, there is the step of providing service to an entity of the N entities which has the earliest receive time and a request time, unless there is more than one entity with the earliest receive time in which case the entity with the earliest request time receives service from the server. Preferably, after the providing step, there is the step of repeating the providing step in regard to other entities. The controller 22 can cause the steps to be implemented. If rate control is used, then there is the alternative criteria of if there is no entity with a request time less than or equal to virtual time, then the server is idle.

The present invention also pertains to a method for scheduling when a server 14 provides service to entities, as shown in FIG. 23. The method comprises the steps of identifying when an entity requests service from the server 14. The process for identifying when a first entity requests service from the server can include any technique or method for calculating when the first entity requests service from the server 14. This can include identifying when the request occurs by actually determining the time when the entity requests service from the server 14. Or, it can be calculated from when a previous entity has requested service from the server 14 and determined by some function or relationship when the entity requests service from the server 14. Or, it can be determined as a function of another entity which is currently receiving service from the server 14. Alternatively, the time when the first entity requests service can be identified from a time when the entity is to receive service from the server 14. For instance, start time plus 1/W_(i) equals finish time.

Additionally, the identifying step can be part of a calculation where at some point in the overall process of identifying time for the server to provide service to the entity, the time when the entity requests service from the server is identified. Basically, the identifying step can be a conclusion to a process or as an interim step to a process. The entity preferably is a first entity which requests service from the server 14.

The method for scheduling when a server 14 provides service to entities next comprises the step of providing service to an entity as a function of when the entity requests service from the server 14. The entity can be the first entity and it receives service from the server 14 as a function of when the first entity requests the service from the server 14. It is preferably when the first entity first requests service from the server 14 that is a basis for providing service to the first entity. Alternatively, the step of providing service to an entity can be the step of providing service to a second entity as a function of when the first entity requests service from the server 14. The time when the second entity receives service is then some functional relationship of when the first entity first requested service from the server 14. For instance, if service is provided to the first entity at V=1, then service to the second entity is provided at time V=2 or V=1+1, where V=1 is the time the first entity requests service from the server 14. If rate control is utilized, then the providing step is a function of virtual time, and there is the additional step of incrementing virtual time by one unit of virtual time after a predetermined period of time. In the preferred embodiment, virtual time is incremented by one unit of virtual time after a predetermined period of time, regardless of any other considerations.

The present invention pertains to a scheduler for controlling when a server provides service to entities. The scheduler comprises a memory, having times which are a function of when entities request service from the server 14. The scheduler 10 also comprises a virtual clock 20 that keeps track of time as a function of when entities request service from the server 14. Additionally, the scheduler 10 comprises a controller 22 which causes an entity to receive service from the server 14 as a function of when the entity requests service from the server 14. The memory can be a starting time, such as a priority queue 16. If rate control is utilized, then the virtual clock keeps track of time as a function of a predetermined period of time whether or not there is no service provided to an entity.

In the operation of the invention, several users receive service from a server 14. The users have cells which either at separate times or at the same time require the operation of the server 14. As long as no user having cells calls upon the server 14 at the same time, or are waiting for the server 14, a user will request service from the server 14 and receive service from it. However, if this is not the case, then a scheduler 10 will schedule when the users with cells will be served by the server 14.

During operation, the scheduler 10 logs in the time a user first requests service from the server 14. The scheduler 10 also logs in the latest time the user should finish waiting for service from the server 14. The scheduler 10 records the start time and the finish time for each user that requests service from the server 14. This information is obtained from the user and from the virtual clock 20 identifying when the user has first started waiting for the service from the server 14. This can occur by the entity sending a signal to the server 14 or the scheduler 10 when it requests service; or by the scheduler 10 or the server 14 using a sensor, or trigger to identify when the entity is requesting service. This aspect of the invention can be similar to how a telecommunications switch operates to switch signals which arrive at the switch from several connections, as is well known in the art.

When the server 14 is available to service a user, the scheduler 10 determines which user of the users waiting for service from the server 14 has the earliest finishing time. The user with the earliest finishing time is then provided service by the server 14 and the user's cell is operated upon by the server 14. If the users have the same finishing time, then the server looks at which user has the earliest start time and provides service to the user with the earliest start time. The scheduler 10 causes the user to receive service from a server 14 even though its time to finish waiting for service may not as yet have occurred.

As each user is served by the server 14, the scheduler 10 looks for the next user to receive service from the server 14. A user that has a high rate will receive service from the server 14 more often than a user with a lower rate. However, as the user with the higher rate receives service from server 14, there will be instances where a user with a lower rate will receive service from the server 14 because it will have an earlier finish time and/or an earlier start time than a user with a higher rate. Because the scheduler 10 is not controlled by the user receiving service from the server 14 when its finish time occurs, users with lower rates can receive service from the server 14 intermittently when the server 14 is not providing service to a higher rate. Thus, because the server 14 is controlled by the fact that over a given unit cycle of operation, it has certain service capability, and that all the rates of the different users combine to equal that unit rate for the cycle, then over the course of a cycle, each user will have service provided by the server 14.

As a simple example, five users A-E have rates of 0.5, 0.2, 0.1, 0.1, 0.1, respectively. At time V=0, each user A-E has a cell which arrives for service from a server 14. The cell from user A has a finishing time of V=2, the cell from user B has a finishing time of V=5, and the cells from users C, D and E have finishing times of V=10. This is shown in FIG. 2.

At time V=0, since the cell from user A is present and it has the earliest finishing time of V=2 of all the cells waiting for service, the server 14 services user A. Because the server 14 services user A, the time is advanced one unit to V=1.

At time V=1, the server 14 serves the cell from user B, since it has the earliest finishing time of V=5, as shown in FIG. 3. Since the server 14 operates on the cell of user B, the time is incremented by one unit so V=2.

At V=2, a cell from user A arrives having a start time of V=2 and a finish time of V=4, as shown in FIG. 4. At V=2, the server 14 services the cell from user A because the finishing time for the cell of user A of V=4 has the earliest finish time. When server 14 operates on the cell of user A, the time is advanced to V=3.

At time V=3, the server 14 operates on the cell from user C since it has as early a finish time of V=10 as any of the cells waiting for service, as shown in FIG. 5. Upon the server 14 serving the cell from user C, the time is advanced to V=4.

At time V=4, a cell from user A arrives to be serviced by the server 14. It arrives at time V=4 and has a finish time of V=6, as shown in FIG. 6. The server 14 serves the cell from user A since it has the earliest finish time of V=6. The time is then advanced to V=5.

At time V=5, a cell from user B arrives to receive service from server 14. The cell has a start time of V=5 and a finish time of V=10. At time V=5, the server 14 provides service to the cell from user D since all the cells waiting for service have the same finish time but the cell from user D has a start time of 0, which is as early as a cell from user E but earlier than the cell from user B. See FIG. 7. After the server 14 services the cell from user D, the time is advanced to V=6.

At time V=6, a cell from user A arrives for service from server 14. The cell has a starting time of V=6 and a finish time of V=8. The server 14 provides service to the cell from user A since the cell has the earliest finish time of the cells waiting for service from server 14. See FIG. 8. Upon servicing by the server of the cell from user A, the time is advanced to V=7.

At time V=7, the server 14 provides service to the cell from user E since it has the earliest start time of V=0 and the same finish time as the cell from user B waiting for service from the server 14. See FIG. 9. After the server 14 provides service to the cell from user E, the time is advanced to V=8.

At time V=8, a cell from user A arrives for service from the server 14. At time V=8, the server 14 provides service to the cell from user B since it has the earliest start time of V=5 and the same finish time as the cell from user A waiting for service from the server 14. See FIG. 10. After the server 14 provides service to the cell from user B, the time advances to V=9.

At time V=9, the server 14 provides service to the cell from user A since it has the earliest finish time of any cells waiting for service from the server 14. See FIG. 11. See FIG. 11. At this point in time, a unit cycle has been completed and all the users have received service. After the server 14 provides service to the cell of user A, the time advances to V=10.

At time V=10, a cell from user A arrives for service with a finish time of V=12, a cell from user B arrives for service with a finish time of V=15, and a cell from each of users C, D and E arrive with finish times of V=20 (not shown). The cycle then repeats itself as described above.

Another simple example that describes operation of the scheduler when the rates of the users add to be less than one is now given. In this example, there are three users A-C having rates of 0.5, 0.2 and 0.1, respectively.

At time V=0, cells from user A, B and C have arrived having start times of V=0. The cell from user A has a finish time of V=2, the cell from user B has a finish time of V=5, and the cell from user C has a finish time of V=10. See FIG. 12. At V=0, the cell from user A receives service from server 14 since it has the earliest finishing time of V=2 of the cells. Because the server 14 services user A, the time is advanced one unit to V=1.

At V=1, the server 14 services the cell from user B, since it has the earliest finishing time of V=5 of the cells. See FIG. 13. The time is then advanced by one increment to V=2.

At time V=2, a cell from user A arrives for service from the server 14. The server 14 services the cell from user A since it has the earliest finish time of V=4 of the cells. See FIG. 14. The time is then advanced by one increment to V=3.

At time V=3, the server provides service to the cell from user C since it is the only cell that has a starting time earlier than the present virtual time of V=3 and it also has a finish time of V=10. See FIG. 15.

After the server 14 services the cell from user C, the virtual time is advanced by one increment to the earliest starting time of a cell that requires service from the server 14. In this case, the earliest starting time of a cell waiting for service is V=4, which happens to be one increment of time from V=3.

At time V=4, a cell from user A arrives for service from the server 14. The server 14 provides service to the cell from user A since it has a start time of V=4, which is equal to the present virtual time, and has a finish time of V=6 which is the earliest finishing time of any cell waiting for service from the server 14. See FIG. 16. Upon the server 14 providing service to the cell from user A, there being no other cells having starting times earlier or at the present virtual time of V=4, the virtual time is incremented to the earliest start time of a cell that desires service from server 14. In this case, the virtual time is incremented by one unit to V=5 since the cell from user B will have a start time of V=5 when it requests service from the server 14.

At time V=5, a cell from user B arrives for service from server 14. At time V=5, the server from server 14 provides service to the cell from user B since the cell from user B has the earliest finish time of any cell waiting for service from server 14. See FIG. 17. Upon the server 14 providing service to the cell from user B, the virtual time is incremented to the next virtual time that corresponds to the earliest start time that a cell would require service from the server 14. In this instance, a cell from user A has a start time of V=6. Accordingly, time is incremented by one unit to V=6.

At time V=6, a cell from user A arrives for service from server 14. At time V=6, the server 14 provides service to the cell from user A because it has the earliest finish time. See FIG. 18. The virtual time is then incremented to V=8 and not to V=7 since the earliest start time of a cell waiting for service from server 14 will occur at V=8. Thus, the virtual time is incremented by two units in this instance. It should be noted that if a rate control embodiment was implemented where the virtual time is incremented by 1 unit of time virtual time would be incremented to V=7, not V=8. At V=7, the server 14 would not provide service to any user. After a predetermined period of time, the virtual time is then incremented one unit to V=8.

At time V=8, a cell from user A arrives for service from the server 14. Server 14 provides service to the cell from user A since it has the earliest finish time. See FIG. 19. After the server 14 provides service to the cell from user A, time is incremented to V=10 since at V=10 is the earliest start time for cells waiting for service from server 14. The virtual time is then incremented by two units from V=8 to V=10.

At V=10, cells from users A, B and C arrive for service from server 14. The finish time for the cell from user A is V=12, the finish time for the cell from user B is V=15 and the finish time for the cell from user C is V=20 (not shown). At V=10, there are no cells appearing for service since the figure only goes up to V=10 but V=10 is shown in FIG. 20 since there are finish times associated with V=10, although they are not shown.

Several examples of the implementation of the invention are found in the appendix. Note, the RC before VSQ stands for rate control in two of the examples. To better understand these examples which show elements which are preferably cells in regard to an ATM network arriving into an element pool 24 to be operated upon by a server 14, several operations of the scheduler 10 will be described.

In example 1, there are three entities 12 connected to an element pool 24. These entities 12 have associated with them a weight and a rate. For instance, user 0 associated with the 0th entity 12 has a weight of 0.5 and a rate of 0.5. User 1 associated with the first entity 12 has a weight of 0.333 and a rate of 0.333. User 2 associated with the second entity 12 has a weight of 0.166 and a rate of 0.166. At time T=1, the virtual time is 0. Cells 000, 001 and 002, corresponding with the 0th, 1st, 2nd entities 12 of the 0th, 1st and 2nd users arrive at the element pool 24. Their start times when they first started in the element pool 24 and their finish times when they are to have left the element pool 24 are recorded in the starting priority queue 16 and the finishing time priority queue 18, respectively. This is shown in the start time column and the finish time column and the start queue column and the finish queue column.

In the start time column, user 0 has the second or last position in regard to when the cell 000 associated with the 0th user arrived in the element pool 24. The time that the element arrived in the element pool is at time T=0. In the finish time column, the user 0 has the first or 0th position, since its finish time of T=2000 is the earliest finishing time of all the elements in the element pool 24. For user 0, there is a quantity Q identified in the column Q showing there is but 1 cell of user 0 in the element pool 24. In the start queue column, user 0 is in the last or second position and its starting time T=0. However, in the finishing time priority queue 18 under the finish queue column, user 0 is in the 0th position because the time T=2000 is the earliest finishing time of all the elements in the element pool 24.

In regard to user 1, it has a start time position of 1 and an associated start time T=0. Its finish time position is also 1 because its finish time of T=3000 is the second earliest finishing time of the three cells in the element pool 24. There is a quantity of one cell in the element pool 24 associated with user 1 and in the starting time priority queue 16, the user 1 is in the 1 position with its time T=0. User 1 also has the 1 position in the finish queue column since its time to finish is the second earliest of the cells in the element pool 24.

User 2 has the earliest or 0th position in the starting time priority queue 16 and has time T=0. It has a finishing time position of last or 2 since its time T=6000 is the latest finish time of all the cells in the element pool 24. The user 2 has a quantity Q of one cell in the element pool 24 and a start queue position of 0 with a time T=0. In the finishing time priority queue 18, it has a finish queue position of 2 because its finish time of T=6000 is the latest finishing time of the three cells in the element pool 24.

In operation at time 0000, the cell of user 0 is operated upon by the server 14. This is reflected by the user 0 having a start time of -1 with a time T=0 and a finish time of position -1 for time T=2000. The quantity Q of user 0 is now 0 since its corresponding cell has been operated upon by the server 14 and is no longer in the element pool 24. In the starting time priority queue 16, the user 0 has a position of -1 with a time T=-1 reflecting the fact that the user 0 is no longer present in the element pool. The finishing time priority queue 18 also reflects the finishing queue of user 0 having a -1 in the element pool 24 since the cell associated with user 0 is no longer present in the element pool 24. Because the server can only operate on one cell at a time, only the cell of user 0, which has the earliest finishing time, is removed from the element pool 24. The remaining users have their positions moved up one notch in regard to their finish time since now time T=3000 for the cell of user 1 is the earliest finishing time and the time T=6000 for the cell associated with user 2 is now the second latest finishing time. Also, as is apparent from the example, since all the cells of user 0, 1 and 2 have arrived at the same starting time in the element pool 24, even though their weights may be different, they are ordered in the starting time priority queue 16 on the basis; of highest user number to lowest user number, although essentially any scheme of ordering could be chosen.

At time T=2 and the virtual time now equal to 1000 (since the server 14 has just operated on a cell, the virtual time is increased by one unit of virtual time--here 1000) new cells from user 1, user 2 and user 3 arrive at the element pool 24. User 0 has a start time of T=2000 since that is the time identified with its arrival in the start time priority queue 16. It has a position of 1 in the finish time priority queue 18 because its finish time T=4000 is second earliest of the cells in the finish time. In addition, the quantities of user 1 and user 2 are now both 2 since each of these users also have additional cells in the element pool 24 at time T=2. Since user 1 has the earliest finishing time of 3000 of all the cells in the element pool 24, and it also has a start time of T=0 which is earlier than the time V=1000 and is thus present in the element pool 24, then it is this cell which is the cell in the element pool 24 which is provided to the server 14 to be operated upon by the server 14. Thus, in the next operation of the server 14, the server 14 serves the cell of user 1 that has the finishing time of T=3000. This cell is removed from the element pool 24, and the starting time priority queue 16 and finish time priority queue 18 are thus adjusted. The quantity of cells for user 1 is now reduced to 1 while the quantity of cells for user 0 remains 1 and the quantity of cells for user 2 remains 2. Since there is a remaining cell still in the element pool 24 for user 1, its presence becomes apparent in the start time column with a time T=3000 and a finish time of T=6000 in the finish time column.

At time T=3, V=2000 since a cell was operated upon by this server 14 causing the virtual time of V=1000 to be incremented by one unit of time. At time T=3 and V=2000, only one new cell arrives. This new cell is from user 0. This is reflected by the quantity of cells in the element pool 24 being 2 for the user 0. At this time, user 0 has a cell in the finishing time priority queue 18 of T=4000, which is the earliest finishing time. Since this cell also has a start time of T=2000, it is present in the element pool 24 at time V=2000 and it is the cell to be operated upon by the server 14. When the server operates at T=3 and virtual time equal to 2000, the cell of user 0 having finishing time T=4000 is removed from the element pool 24 and is operated upon by the server 14. The quantity of cells associated with user 0 in the element pool 24 is then reduced by 1.

At this point, all the finishing times of all the cells of the users are T=6000. Thus, in regard to the finishing times all being equal, the start times then become controlling in terms of which cell is operated upon next by the server. This can be seen at time T=4 and V=3000 where user 2 has two cells in the element pool 24 with the earliest one having a start time T=0. It is this cell of user 2 that is then operated upon by the server 14. The remainder of the examples should be understood based on the explanation above.

In a specific application of the invention, an ATM switch element has one to N input connections 102 and one to M output connections 104, as shown in FIG. 21. ATM cells are received by the switch element 100 through the input connections 102. The switch element 100 operates on the cells and sends them on their way through output connections 104. Whenever a cell comes in over a specific input connection 102, it is placed in a pool 106, as is well known in the art, and informs the scheduler 108 of the switch element, as is well known in the art, of the presence of the cell in the corresponding pool 106. It should be noted that each input connection 102 can have its own unique pool 106 in which cells entering the switch element 102 are stored or there can be a common pool 106 in which all cells from each individual input connection 102 are stored until the server 110 of the switch element is ready to operate upon them.

The scheduler 108 of the switch element 100 operates as described above except in the ATM context, the finish time is determined by the finish time identified in the scheduler for the cell as well as a bid value that has been provided by the cell in order to obtain service by the server 110 of the switch element 100. This use of a bid is well known in the art. See, for instance, "Gigabit Networking" by Craig Partridge, Addison Wesley, 1994; "ATM User Network Interface Specification, Version 3.0" by the ATM Forum, Prentice Hall, 1994; "Asynchronous Transfer Mode Networks: Performance Issues", by Raif O. Onvural, Artech House, Inc., Norwood, Mass. 1994, and "Comparison of Rate-Based Service Disciplines" by Hui Zhang and Srinivasov Keshav, Proceedings of ACM SIGCOMM '91, all of which are incorporated by reference.

In regard to packets, every packet can be stamped as is known in the art. Furthermore, as is known in the art, and from the above, the packet at the head of a queue can be computed based on the above and not all of the packets in that queue need to be stamped. Ideally, the first N packets could be stamped, and any packets thereafter would not need to be stamped, where N is the maximum number of service intervals a packet can be late in receiving service.

Generally, for the i'th packet, ##EQU8## where L=length of the i'th packet

and a_(k) ^(i) is the arrival time of the i'th packet for service

and v(a_(k) ^(i)) is the virtual time at the arrival time a_(k) ^(i).

Although the invention has been described in detail in the foregoing embodiments for the purpose of illustration, it is to be understood that such detail is solely for that purpose and that variations can be made therein by those skilled in the art without departing from the spirit and scope of the invention except as it may be described by the following claims. ##SPC1## 

What is claimed is:
 1. A scheduler for controlling when N entities, where N is an integer ≧2, are operated upon by a server, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total<1, comprising:a starting time memory having arrival times s_(i) of the N entities, where 2≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity first requests service from the server; a finishing time memory having finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity is to be operated upon by the server; a virtual clock that keeps track of virtual time so the arrival times s_(i) and finishing times f_(i) can be identified, said virtual clock increments virtual time as a function of time regardless of any other considerations; and a controller which chooses entities to be operated upon by the server so the server provides service at an established rate with rate control, and no faster, in the order of the entities with an earliest finishing time f_(i) and an arrival time s_(i) being operated upon first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being operated upon next at each given time, with entities able to be operated upon by the server before their finishing time f_(i), else if there is no entity with an arrival time less than or equal to virtual time, the server does not provide service to any entity.
 2. An apparatus as described in claim 1 wherein the controller provides service to the entities from the server sequentially.
 3. An apparatus as described in claim 1 wherein the controller causes the virtual clock to move present virtual time forward by one unit of virtual time after a predetermined time has passed if the server does not provide service to an entity.
 4. An apparatus as described in claim 3 wherein the starting time memory is a starting time priority queue and the finish time memory is a finishing time priority queue.
 5. A scheduler as described in claim 4 including an element pool which is connected with the N entities and receives elements from the N entities to be operated upon by the server, and wherein the arrival times s_(i) of elements corresponds to the time an element from the i'th entity arrives in the element pool and the finishing times f_(i) compared to the time an element from the i'th entity is to leave the element pool and be operated upon by the server and the controller transfers elements to the server from the element pool.
 6. An apparatus as described in claim 5 wherein the controller is connected to the virtual clock, the element pool, the starting time memory and the finishing time memory for controlling time of the virtual clock, storing the elements in the element pool and their arrival times s_(i) and their finishing times f_(i) in the starting time priority queue and the finishing time priority queue, respectively.
 7. An apparatus as described in claim 6 wherein the controller transfers the element out of the element pool which has the earliest finishing time f_(i) and a starting time s_(i), unless there is more than one element with the earliest finishing time f_(i) in which case the element with the earliest starting time s_(i) is transferred out of the element pool by the controller and before its finishing time f_(i), unless there is no element with a starting time s_(i) less than or equal to virtual time, in the element pool, in which case the controller does not transfer an element from the element pool.
 8. An apparatus as described in claim 1 wherein the controller causes the virtual clock to increment virtual time by one unit of virtual time after a predetermined period of time.
 9. A method of scheduling when a server provides service to entities comprising the steps of:requesting service from the server by N entities, where N≧1 and is an integer; storing when each of the N entities first requests service from the server and when each of the N entities is to have received service from the server; and providing an entity of the N entities service which has the earliest receiving time and a request time, unless there is more than one entity with the earliest receiving time in which case the entity with the earliest request time is provided service by the server and possibly before its finishing time; unless there is no entity with a request time less than or equal to virtual time, in which case the server does not provide service to an entity.
 10. A method as described in claim 9 including after the providing step, there is the step of repeating the providing step in regard to other entities who have requested service from the server.
 11. A scheduler for controlling when N entities, where N is an integer ≧2, are operated upon by a server, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total ≦1, comprising:a starting time memory having starting times s_(i) of the N entities, where 2≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity first requests to be operated upon by the server; a finishing time memory having finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity is to have been operated upon by the server; a virtual clock that keeps track of virtual time so present virtual time, arrival times s_(i) and finishing times f_(i) can be identified; and a controller which chooses entities to be operated upon by the server so the server provides service at an established rate with rate control, and no faster, in the order of the entity with an earliest finishing time f_(i) and a starting time s_(i) being operated upon first, and then the entities based on a predetermined criteria, said controller causing the virtual clock to increment present virtual time by a unit of virtual time after a predetermined period of time regardless of any other considerations.
 12. A scheduler for scheduling when N entities, where N is an integer ≧1 are served by a server comprising:a starting time memory having starting times s_(i) when the N entities request service, where 1≦i≦N and is an integer, and s_(i) is the time at which the i'th entity may next get service from the server; a finishing time memory having finishing times f_(i) when the N entities should be serviced, where f_(i) is the time by which the i'th entity should be serviced by the server; a virtual clock that keeps track of time V_(k) where k≧0 and is an integer and

    V.sub.k =V.sub.k-1 +1

where V_(k-1) is the virtual time when the server last served an entity; and a controller which chooses which entity is to be operated upon by the server in the order of the entity with an earliest finishing time f_(i) and a start time s_(i) receiving service first, and then the entities based on a predetermined criteria unless there is no entity with a starting time s_(i) less than or equal to virtual time, in which case the server is idle.
 13. A scheduler for controlling when a server provides service to entities, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total ≦1, comprising:a memory having times which are a function of when entities request service from the server; a virtual clock that keeps track of virtual time as a function of a predetermined period of time if there is no service provided to an entity; and a controller which causes an entity to receive service from the server as a function of virtual time regardless of any other considerations so the server provides service at an established rate with rate control, and no faster.
 14. A method for scheduling when a server provides service to entities comprising the steps of:identifying when entities request service from the server, where each entity has a rate at which it is to receive service from the server, at least two entities having different rates, all rates total ≦1; providing service to all the entities as a function of virtual time; and incrementing virtual time by one unit of virtual time or after a predetermined period of time if there is no service provided to an entity regardless of any other considerations so the server provides service at an established rate with rate control, and no faster.
 15. A method as described in claim 14 wherein the incrementing step includes the step of incrementing virtual time by one unit of virtual time after a predetermined period of time if there is no service provided to an entity.
 16. A scheduler for controlling when N entities, where N is an integer ≧2, are operated upon by a server, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total ≦1 comprising:a memory mechanism having arrival times s_(i) of the N entities, where 2≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity first requests service from the server and finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity is to be operated upon by the server; a virtual clock that keeps track of virtual time so the arrival times s_(i) and finishing times f_(i) can be identified, said virtual clock increments virtual time as a function of time regardless of any other considerations; and a controller which chooses entities to be operated upon by the server so the server provides service at an established rate with rate control, and no faster, in the order of the entities with an earliest finishing time f_(i) and an arrival time s_(i) being operated upon first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being operated upon next at each given time, with entities able to be operated upon by the server before their finishing time f_(i), else if there is no entity with an arrival time less than or equal to virtual time, the server does not provide service to any entity.
 17. A scheduler for controlling when N entities, where N is an integer ≧2, are operated upon by a server, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total ≦1, comprising:a memory mechanism having arrival times s_(i) of the N entities, where 2≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity first requests service from the server and finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity is to be operated upon by the server; a virtual clock that keeps track of virtual time so the arrival times s_(i) and finishing times f_(i) can be identified, said virtual clock increments virtual time as a function of time; and a controller which chooses entities to be operated upon by the server so the server provides service at an established rate with rate control, and no faster, in the order of the entities with an earliest finishing time f_(i) and an arrival time s_(i) being operated upon first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being operated upon next at each given time, with entities able to be operated upon by the server before their finishing time f_(i), else if there is no entity with an arrival time less than or equal to virtual time, the server does not provide service to any entity.
 18. A scheduler for controlling when N entities, where N is an integer ≧2, are operated upon by a server, each entity having a rate at which it is to receive service from the server, at least two entities having different rates, all rates of the entities total ≦1, comprising:a starting time memory having arrival times s_(i) of the N entities, where 2≦i<N and is an integer, and s_(i) corresponds to the time the i'th entity first requests service from the server; a finishing time memory having finishing times f_(i) of the N entities, where f_(i) corresponds to the time the i'th entity is to be operated upon by the server; a virtual clock that keeps track of virtual time so the arrival times s_(i) and finishing times f_(i) can be identified; and a controller which chooses entities to be operated upon by the server so the server provides service at an established rate with rate control, and no faster, in the order of the entities with an earliest finishing time f_(i) and an arrival time s_(i) being operated upon first, and then the entities with the earliest or latest starting time s_(i) or having the highest or lowest id or rate if their finishing times are the same being operated upon next at each given time, with entities able to be operated upon by the server before their finishing time f_(i), else if there is no entity with an arrival time less than or equal to virtual time, the server does not provide service to any entity.
 19. A scheduler as described in claim 1 wherein the virtual clock keeps track of virtual time so each request for service from the server by an entity is schedulable and each entity will receive service from the server. 